<template>
    <div id="box">
        <h1>js字符串压缩</h1>
        <el-input
                type="textarea"
                :rows="10"
                placeholder="请输入要js压缩的文本"
                v-model="input_js">
        </el-input>
        <br><br><br>
        <el-button type="primary" @click="execute">↓压缩↓</el-button>
        <br><br><br>
        <el-input
                class="text"
                type="textarea"
                :rows="10"
                placeholder="压缩后的js文本"
                v-model="output_js"
                >
        </el-input>
    </div>
</template>

<script>
    export default {
        name: "js压缩",
        data(){
          return{
                input_js:'',
              output_js:''
          }
        },
        methods:{
            execute:function(){
               var _this = this;
                this.axios.post('/api/ysjs/',{'input':_this.input_js}).then(function(response){
                    _this.output_js = response['data']['msg']
                })
            }
        }
    }
</script>

<style scoped>

</style>